<template>
	<!--到货信息-->
	<div class="header">
		<div>
			<span class="label">到货登记号:</span>
			<span class="value">{{store.arrivalCode}}</span>
		</div>
		<div>
			<span class="label">供应商:</span>
			<span class="value">{{store.supplier}}</span>
		</div>
		<div>
			<span class="label">到货日期:</span>
			<span class="value">{{store.arrivalDate}}</span>
		</div>
	</div>
	
	<!--入库明细-->
	 <template v-for="item in store.child">
		 <StockItem :value="item"></StockItem>
	 </template>
</template>

<script setup>
	import {ref,onMounted} from 'vue'
	import StockItem from './StockItem.vue'
	import {queryDetail} from '@/api/instore.js'
	import {useRoute} from 'vue-router'
	//路由信息
	const route=useRoute();
	
	
	//声明响应式数据
	const store=ref({});
	
	
	async function init(id){
		let res=await queryDetail(id);
		if(res.code==200){
			store.value=res.data;
		}
		console.log(store.value)
	}
	
	onMounted(()=>{
		let id=route.query.id;
		init(id);
	});
	
</script>

<style scoped>
	.header{
		width: 7.2rem;
		margin: auto;
		padding: 0.2rem 0;
	}
	.header div{
		height: 0.5rem;
		line-height: 0.5rem;
		margin: 0 0.2rem;
	}
	.label{
		color: #666;
	}
	.value{
		margin-left: 0.1rem;
	}
</style>